import requests
def setTop250Data(bs,names,directors,actors,years,countries,types,srcs):
    for item in bs.select('div.item div.hd span.title:nth-child(1)'):
        names.append(item.text)
    # print(names)
    s = '''
    导演: 弗洛里安·亨克尔·冯·多纳斯马尔克 Florian Henckel von Donnersmarck  &amp;n...<br/>
                            2006 / 德国 / 剧情 悬疑 1
    '''
    for item in bs.select('div.item div.bd p:nth-child(1)'):
        s = item.decode_contents().strip()
        as1 = s.split("<br/>")
        as3 = as1[0].split('   ')
        # print(as3[0].split(':')[1].strip())
        # print(s,len(as3))
        #取导演信息
        directors.append(as3[0].split(':')[1].strip())
        # print(len(as3))
        #取主演信息,有些主演信息有问题
        try :
            ta = as3[1].split(':')
            if len(ta)>1:
                actors.append(ta[1].strip())
            else:
                actors.append('无信息')
        except IndexError:
            actors.append('无信息')

        as2 = as1[1].split(' / ')
        years.append(as2[0].strip())
        countries.append(as2[1].strip().replace(' ','|'))
        types.append(as2[2].strip().replace(' ','|'))
        # print(as2[0],as2[1],as2[2])
    for item in bs.select('div.item img'):
        srcs.append(item.get('src'))

def handlerImg(name,url):
    resp = requests.get(url)
    with open(f'data/{name}.jpg','wb') as f:
        f.write(resp.content)